#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by master on 2017/3/5

# 经典类写法
class A:
    n = "A"

    def f2(self):
        print("f2 from A")


class B(A):
    n = "B"

    def f1(self):
        print("f1 from B")

    def f2(self):
        print("f2 from B")


class C(A):
    n = "C"

    def f2(self):
        print("f2 from C")


class D(B, C):
    n = "D"


d = D()

d.f1()
d.f2()  # 按照广度优先  先从左到右找同一级别 如果没有的话 再往上查找
        # 经典类里是按照深度优先的顺序 只限于2.x版本
